import java.util.Scanner;

public class Learn6 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n =scanner.nextInt();
        int count = 0;
        while (n != 0) {
            n = n & (n - 1);         //每次会去掉二进制上的一个 1
            count++;
        }
        System.out.println(count);
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n =scanner.nextInt();
        int count = 0;
        int i = 0;
        while(i < 32){
            if(((n>>i)&1)==1){
                count++;
            }
            i++;
        }
        System.out.println(count);
    }
}
